package com.loukou.lkt.lkt.enums;

public enum VoucherPrefixEnum {
	
	PREFIX_PURCHASE_ORDER(0,"PC"),
	
	PREFIX_STOCK_IN_ORDER(1,"RC"),
	
	PREFIX_PICKING_ORDER(2,"DV"),
	
	PREFIX_STOCK_OUT_ORDER(3,"SP"),
	
	PREFIX_OVERFLOW_ORDER(4,"TF"),
	
	PREFIX_LOSS_ORDER(5,"DF"),
	
	PREFIX_ALLOCATION_DIFFERENCE_ORDER(9,"LS"),
	
	PREFIX_ALLOCATION_ORDER(10,"OV"),
	
	PREFIX_TRANSFER_ORDER(11,"MV"),
	
	PREFIX_RETURN_ORDER(12, "RO");
	
	private int id;
	private String name;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	private VoucherPrefixEnum(int id, String name){
		this.id = id;
		this.name = name;
	}
	
	public static VoucherPrefixEnum parseEnum(int id) {
		for (VoucherPrefixEnum e : VoucherPrefixEnum.values()) {
			if(e.id == id){
				return e;
			}
		}
		return PREFIX_PURCHASE_ORDER;
	}

}
